<template>
	<div>
		<div>{{fromSonMes}}</div>
		<button style="margin: 1.25rem;" @click='send'>父组件给son1传值</button>
		<son1 :message='faterData' ref="son1" @fromSon1='setDataFromSon'></son1>
		<son2></son2>
	</div>
</template>

<script>
import son1 from '../components/son1.vue'
import son2 from '../components/son2.vue'

export default{
	components:{
		son1,son2
	},
	data() {
		return {
			faterData:'from fater',
			fromSonMes:''
		}
	},
	methods: {
		send(){
			let data = new Date()
			this.$refs.son1.setData(data)

		},
		setDataFromSon(data){
			this.fromSonMes=data
		}
	},
}
</script>

<style></style>
